Optimal. Leaf size=89 \[ \frac {a (c+d x)^4}{4 d}-\frac {6 a d^3 \cos (e+f x)}{f^4}+\frac {3 a d (c+d x)^2 \cos (e+f x)}{f^2}-\frac {6 a d^2 (c+d x) \sin (e+f x)}{f^3}+\frac {a (c+d x)^3 \sin (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 3, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3398, 3377,
2718} \begin {gather*} -\frac {6 a d^2 (c+d x) \sin (e+f x)}{f^3}+\frac {3 a d (c+d x)^2 \cos (e+f x)}{f^2}+\frac {a (c+d x)^3 \sin (e+f x)}{f}+\frac {a (c+d x)^4}{4 d}-\frac {6 a d^3 \cos (e+f x)}{f^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2718
Rule 3377
Rule 3398
Rubi steps
\begin {align*} \int (c+d x)^3 (a+a \cos (e+f x)) \, dx &=\int \left (a (c+d x)^3+a (c+d x)^3 \cos (e+f x)\right ) \, dx\\ &=\frac {a (c+d x)^4}{4 d}+a \int (c+d x)^3 \cos (e+f x) \, dx\\ &=\frac {a (c+d x)^4}{4 d}+\frac {a (c+d x)^3 \sin (e+f x)}{f}-\frac {(3 a d) \int (c+d x)^2 \sin (e+f x) \, dx}{f}\\ &=\frac {a (c+d x)^4}{4 d}+\frac {3 a d (c+d x)^2 \cos (e+f x)}{f^2}+\frac {a (c+d x)^3 \sin (e+f x)}{f}-\frac {\left (6 a d^2\right ) \int (c+d x) \cos (e+f x) \, dx}{f^2}\\ &=\frac {a (c+d x)^4}{4 d}+\frac {3 a d (c+d x)^2 \cos (e+f x)}{f^2}-\frac {6 a d^2 (c+d x) \sin (e+f x)}{f^3}+\frac {a (c+d x)^3 \sin (e+f x)}{f}+\frac {\left (6 a d^3\right ) \int \sin (e+f x) \, dx}{f^3}\\ &=\frac {a (c+d x)^4}{4 d}-\frac {6 a d^3 \cos (e+f x)}{f^4}+\frac {3 a d (c+d x)^2 \cos (e+f x)}{f^2}-\frac {6 a d^2 (c+d x) \sin (e+f x)}{f^3}+\frac {a (c+d x)^3 \sin (e+f x)}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.31, size = 122, normalized size = 1.37 \begin {gather*} a \left (\frac {1}{4} x \left (4 c^3+6 c^2 d x+4 c d^2 x^2+d^3 x^3\right )+\frac {3 d \left (c^2 f^2+2 c d f^2 x+d^2 \left (-2+f^2 x^2\right )\right ) \cos (e+f x)}{f^4}+\frac {(c+d x) \left (c^2 f^2+2 c d f^2 x+d^2 \left (-6+f^2 x^2\right )\right ) \sin (e+f x)}{f^3}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(475\) vs.
\(2(87)=174\).
time = 0.11, size = 476, normalized size = 5.35
method | result | size |
risch | \(\frac {a \,d^{3} x^{4}}{4}+a c \,d^{2} x^{3}+\frac {3 a d \,c^{2} x^{2}}{2}+a \,c^{3} x +\frac {a \,c^{4}}{4 d}+\frac {3 a d \left (d^{2} x^{2} f^{2}+2 c d \,f^{2} x +c^{2} f^{2}-2 d^{2}\right ) \cos \left (f x +e \right )}{f^{4}}+\frac {a \left (d^{3} f^{2} x^{3}+3 c \,d^{2} f^{2} x^{2}+3 c^{2} d \,f^{2} x +c^{3} f^{2}-6 d^{3} x -6 c \,d^{2}\right ) \sin \left (f x +e \right )}{f^{3}}\) | \(152\) |
norman | \(\frac {\frac {6 a \,c^{2} d \,f^{2}-12 a \,d^{3}}{f^{4}}+a c \,d^{2} x^{3}+a c \,d^{2} x^{3} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\frac {a c \left (c^{2} f^{2}+6 d^{2}\right ) x}{f^{2}}+\frac {a c \left (c^{2} f^{2}-6 d^{2}\right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f^{2}}+\frac {a \,d^{3} x^{4}}{4}+\frac {a \,d^{3} x^{4} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4}+\frac {2 a c \left (c^{2} f^{2}-6 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{3}}+\frac {2 a \,d^{3} x^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {3 d a \left (c^{2} f^{2}+2 d^{2}\right ) x^{2}}{2 f^{2}}+\frac {6 a c \,d^{2} x^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}+\frac {6 d a \left (c^{2} f^{2}-2 d^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{3}}+\frac {3 d a \left (c^{2} f^{2}-2 d^{2}\right ) x^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f^{2}}}{1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )}\) | \(307\) |
derivativedivides | \(\frac {a \,c^{3} \sin \left (f x +e \right )-\frac {3 a \,c^{2} d e \sin \left (f x +e \right )}{f}+\frac {3 a \,c^{2} d \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f}+\frac {3 a c \,d^{2} e^{2} \sin \left (f x +e \right )}{f^{2}}-\frac {6 a c \,d^{2} e \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+\frac {3 a c \,d^{2} \left (\left (f x +e \right )^{2} \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+2 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{2}}-\frac {a \,d^{3} e^{3} \sin \left (f x +e \right )}{f^{3}}+\frac {3 a \,d^{3} e^{2} \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}-\frac {3 a \,d^{3} e \left (\left (f x +e \right )^{2} \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+2 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{3}}+\frac {a \,d^{3} \left (\left (f x +e \right )^{3} \sin \left (f x +e \right )+3 \left (f x +e \right )^{2} \cos \left (f x +e \right )-6 \cos \left (f x +e \right )-6 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}+a \,c^{3} \left (f x +e \right )-\frac {3 a \,c^{2} d e \left (f x +e \right )}{f}+\frac {3 a \,c^{2} d \left (f x +e \right )^{2}}{2 f}+\frac {3 a c \,d^{2} e^{2} \left (f x +e \right )}{f^{2}}-\frac {3 a c \,d^{2} e \left (f x +e \right )^{2}}{f^{2}}+\frac {a c \,d^{2} \left (f x +e \right )^{3}}{f^{2}}-\frac {a \,d^{3} e^{3} \left (f x +e \right )}{f^{3}}+\frac {3 a \,d^{3} e^{2} \left (f x +e \right )^{2}}{2 f^{3}}-\frac {a \,d^{3} e \left (f x +e \right )^{3}}{f^{3}}+\frac {a \,d^{3} \left (f x +e \right )^{4}}{4 f^{3}}}{f}\) | \(476\) |
default | \(\frac {a \,c^{3} \sin \left (f x +e \right )-\frac {3 a \,c^{2} d e \sin \left (f x +e \right )}{f}+\frac {3 a \,c^{2} d \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f}+\frac {3 a c \,d^{2} e^{2} \sin \left (f x +e \right )}{f^{2}}-\frac {6 a c \,d^{2} e \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{2}}+\frac {3 a c \,d^{2} \left (\left (f x +e \right )^{2} \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+2 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{2}}-\frac {a \,d^{3} e^{3} \sin \left (f x +e \right )}{f^{3}}+\frac {3 a \,d^{3} e^{2} \left (\cos \left (f x +e \right )+\left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}-\frac {3 a \,d^{3} e \left (\left (f x +e \right )^{2} \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+2 \left (f x +e \right ) \cos \left (f x +e \right )\right )}{f^{3}}+\frac {a \,d^{3} \left (\left (f x +e \right )^{3} \sin \left (f x +e \right )+3 \left (f x +e \right )^{2} \cos \left (f x +e \right )-6 \cos \left (f x +e \right )-6 \left (f x +e \right ) \sin \left (f x +e \right )\right )}{f^{3}}+a \,c^{3} \left (f x +e \right )-\frac {3 a \,c^{2} d e \left (f x +e \right )}{f}+\frac {3 a \,c^{2} d \left (f x +e \right )^{2}}{2 f}+\frac {3 a c \,d^{2} e^{2} \left (f x +e \right )}{f^{2}}-\frac {3 a c \,d^{2} e \left (f x +e \right )^{2}}{f^{2}}+\frac {a c \,d^{2} \left (f x +e \right )^{3}}{f^{2}}-\frac {a \,d^{3} e^{3} \left (f x +e \right )}{f^{3}}+\frac {3 a \,d^{3} e^{2} \left (f x +e \right )^{2}}{2 f^{3}}-\frac {a \,d^{3} e \left (f x +e \right )^{3}}{f^{3}}+\frac {a \,d^{3} \left (f x +e \right )^{4}}{4 f^{3}}}{f}\) | \(476\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 492 vs.
\(2 (91) = 182\).
time = 0.34, size = 492, normalized size = 5.53 \begin {gather*} \frac {4 \, {\left (f x + e\right )} a c^{3} + \frac {{\left (f x + e\right )}^{4} a d^{3}}{f^{3}} + \frac {4 \, {\left (f x + e\right )}^{3} a c d^{2}}{f^{2}} + \frac {6 \, {\left (f x + e\right )}^{2} a c^{2} d}{f} - \frac {4 \, {\left (f x + e\right )}^{3} a d^{3} e}{f^{3}} - \frac {12 \, {\left (f x + e\right )}^{2} a c d^{2} e}{f^{2}} - \frac {12 \, {\left (f x + e\right )} a c^{2} d e}{f} + 4 \, a c^{3} \sin \left (f x + e\right ) - \frac {12 \, a c^{2} d e \sin \left (f x + e\right )}{f} + \frac {12 \, {\left ({\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} a c^{2} d}{f} + \frac {6 \, {\left (f x + e\right )}^{2} a d^{3} e^{2}}{f^{3}} + \frac {12 \, {\left (f x + e\right )} a c d^{2} e^{2}}{f^{2}} - \frac {24 \, {\left ({\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} a c d^{2} e}{f^{2}} + \frac {12 \, a c d^{2} e^{2} \sin \left (f x + e\right )}{f^{2}} + \frac {12 \, {\left (2 \, {\left (f x + e\right )} \cos \left (f x + e\right ) + {\left ({\left (f x + e\right )}^{2} - 2\right )} \sin \left (f x + e\right )\right )} a c d^{2}}{f^{2}} - \frac {4 \, {\left (f x + e\right )} a d^{3} e^{3}}{f^{3}} + \frac {12 \, {\left ({\left (f x + e\right )} \sin \left (f x + e\right ) + \cos \left (f x + e\right )\right )} a d^{3} e^{2}}{f^{3}} - \frac {12 \, {\left (2 \, {\left (f x + e\right )} \cos \left (f x + e\right ) + {\left ({\left (f x + e\right )}^{2} - 2\right )} \sin \left (f x + e\right )\right )} a d^{3} e}{f^{3}} - \frac {4 \, a d^{3} e^{3} \sin \left (f x + e\right )}{f^{3}} + \frac {4 \, {\left (3 \, {\left ({\left (f x + e\right )}^{2} - 2\right )} \cos \left (f x + e\right ) + {\left ({\left (f x + e\right )}^{3} - 6 \, f x - 6 \, e\right )} \sin \left (f x + e\right )\right )} a d^{3}}{f^{3}}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 170, normalized size = 1.91 \begin {gather*} \frac {a d^{3} f^{4} x^{4} + 4 \, a c d^{2} f^{4} x^{3} + 6 \, a c^{2} d f^{4} x^{2} + 4 \, a c^{3} f^{4} x + 12 \, {\left (a d^{3} f^{2} x^{2} + 2 \, a c d^{2} f^{2} x + a c^{2} d f^{2} - 2 \, a d^{3}\right )} \cos \left (f x + e\right ) + 4 \, {\left (a d^{3} f^{3} x^{3} + 3 \, a c d^{2} f^{3} x^{2} + a c^{3} f^{3} - 6 \, a c d^{2} f + 3 \, {\left (a c^{2} d f^{3} - 2 \, a d^{3} f\right )} x\right )} \sin \left (f x + e\right )}{4 \, f^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 264 vs.
\(2 (88) = 176\).
time = 0.25, size = 264, normalized size = 2.97 \begin {gather*} \begin {cases} a c^{3} x + \frac {a c^{3} \sin {\left (e + f x \right )}}{f} + \frac {3 a c^{2} d x^{2}}{2} + \frac {3 a c^{2} d x \sin {\left (e + f x \right )}}{f} + \frac {3 a c^{2} d \cos {\left (e + f x \right )}}{f^{2}} + a c d^{2} x^{3} + \frac {3 a c d^{2} x^{2} \sin {\left (e + f x \right )}}{f} + \frac {6 a c d^{2} x \cos {\left (e + f x \right )}}{f^{2}} - \frac {6 a c d^{2} \sin {\left (e + f x \right )}}{f^{3}} + \frac {a d^{3} x^{4}}{4} + \frac {a d^{3} x^{3} \sin {\left (e + f x \right )}}{f} + \frac {3 a d^{3} x^{2} \cos {\left (e + f x \right )}}{f^{2}} - \frac {6 a d^{3} x \sin {\left (e + f x \right )}}{f^{3}} - \frac {6 a d^{3} \cos {\left (e + f x \right )}}{f^{4}} & \text {for}\: f \neq 0 \\\left (a \cos {\left (e \right )} + a\right ) \left (c^{3} x + \frac {3 c^{2} d x^{2}}{2} + c d^{2} x^{3} + \frac {d^{3} x^{4}}{4}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 156, normalized size = 1.75 \begin {gather*} \frac {1}{4} \, a d^{3} x^{4} + a c d^{2} x^{3} + \frac {3}{2} \, a c^{2} d x^{2} + a c^{3} x + \frac {3 \, {\left (a d^{3} f^{2} x^{2} + 2 \, a c d^{2} f^{2} x + a c^{2} d f^{2} - 2 \, a d^{3}\right )} \cos \left (f x + e\right )}{f^{4}} + \frac {{\left (a d^{3} f^{3} x^{3} + 3 \, a c d^{2} f^{3} x^{2} + 3 \, a c^{2} d f^{3} x + a c^{3} f^{3} - 6 \, a d^{3} f x - 6 \, a c d^{2} f\right )} \sin \left (f x + e\right )}{f^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.26, size = 189, normalized size = 2.12 \begin {gather*} \frac {\sin \left (e+f\,x\right )\,\left (a\,c^3\,f^2-6\,a\,c\,d^2\right )}{f^3}-\frac {3\,\cos \left (e+f\,x\right )\,\left (2\,a\,d^3-a\,c^2\,d\,f^2\right )}{f^4}+\frac {a\,d^3\,x^4}{4}+a\,c^3\,x-\frac {3\,x\,\sin \left (e+f\,x\right )\,\left (2\,a\,d^3-a\,c^2\,d\,f^2\right )}{f^3}+\frac {3\,a\,c^2\,d\,x^2}{2}+a\,c\,d^2\,x^3+\frac {3\,a\,d^3\,x^2\,\cos \left (e+f\,x\right )}{f^2}+\frac {a\,d^3\,x^3\,\sin \left (e+f\,x\right )}{f}+\frac {6\,a\,c\,d^2\,x\,\cos \left (e+f\,x\right )}{f^2}+\frac {3\,a\,c\,d^2\,x^2\,\sin \left (e+f\,x\right )}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________